Color Menus
This topic discusses how to apply color to menus displayed on a Mac II (or
other color-capable Macintosh) and describes the color features built into
the 256K ROMs.
Adding color to menus can be quite painless; it requires no work beyond
creating an 'mctb' resource and storing it in your application resource file.
Your early call to InitMenus causes the Menu Manager to look around for and read an 'mctb' resource with an ID of 0. The GetMenu function automatically looks for an 'mctb' resource with the same ID as the requested
of menu color table information.
An 'mctb' resource is simply an MCTable (a list of MCEntry structures) preceded by a count of the number of entries. Each entry identifies a menu
ID and an item number and supplies the RGB colors to be applied when that
menu/item is displayed. A menu ID of 0 affects the menu bar and an item ID
of 0 affects a particular menu title in the menu bar.
The table is variable in length; the end of the table is marked by an item
ID of -99. When no entry exists for a menu or item, the default
black-on-white colors apply.
The mctRGBn fields of each MCEntry structure defines the text color, mark color, command key color, and background of an item. The actual
meanings of the fields vary, depending upon the mctID and mctItem fields.
Color Functions
The 256K ROMs' MCxxxx functions are needed only when you want to save,
replace, and restore menu bars or if you want to let the user pick menu
colors interactively. Though you may use some calls to set color
information programmatically (e.g., in your SetupMenus() function), it is
recommended that you simply define your colors using a resource tool.
Menu bar save/re store
GetMCInfo Allocate and make a copy of current menu color table SetMCInfo Install a different menu color table Changing menu colors manually
GetMCEntry See what colors are currently in use for menu/item In menus that use icons, the icon is drawn using the item's "name color
(in MCEntry.mctRGB2) for black and the "background color" (in MCEntry.mctRGB4) for white. However, the Menu Manager will first look for a 'cicn' resource with the specified resource ID and if found, the icon
will be drawn in its 'cicn'- defined colors.
If the 'cicn' is larger than 32 x 32, the default menu defproc will NOT